import { RndInt } from '@/util/rnd.js';

export function residential() {
  return {
    id: 'residential',
    type: 'residential',
    style: RndInt(1, 3),
    height: 1,
    updated: true,
    update() {
      if (Math.random() < 0.01) {
        if (this.height < 5) {
          this.height += 1;
          this.updated = true;
        };
      }
    },
  };
}

export function commercial() {
  return {
    id: 'commercial',
    type: 'commercial',
    style: RndInt(1, 3),
    height: 1,
    updated: true,
    update() {
      if (Math.random() < 0.01) {
        if (this.height < 5) {
          this.height += 1;
          this.updated = true;
        };
      }
    },
  };
}

export function industrial() {
  return {
    id: 'industrial',
    type: 'industrial',
    style: RndInt(1, 3),
    height: 1,
    updated: true,
    update() {
      if (Math.random() < 0.01) {
        if (this.height < 5) {
          this.height += 1;
          this.updated = true;
        };
      }
    },
  };
}
export function road() {
  return {
    id: 'road',
    type: 'road',
    updated: true,
    update() {
      this.updated = false;
    },
  };
}
